package day03;

//逻辑运算是建立在关系型运算的基础之上的
/*
    &&短路与   有假即假，全真为真
    ||短路或   有真即真，全假为假
    ！逻辑非   非真即假，非假即真
    &逻辑与
    |逻辑或
 */
public class Demo03逻辑运算符 {
    public static void main(String[] args) {
        int a = 10, b = 20, c = 30;

        boolean b1 = b >= a && a > c;//false
        System.out.println(b1);
        System.out.println(b < c && a <= c);
        System.out.println(a == b && a >= b);
        System.out.println(b != c && b <= c);
        System.out.println(a > b && a <= c);
        boolean c1 = a > b && a++ > b;
        System.out.println(c1);
        System.out.println(a);

        System.out.println("=====================");
        boolean b2 = b >= a || a > c;
        System.out.println(b2);
        System.out.println(b < c || a <= c);
        System.out.println(a == b || a >= b);
        System.out.println(b != c || b <= c);
        System.out.println(a > b || a <= c);
        boolean c2 = b >= a || b-- > c;
        System.out.println(c2);
        System.out.println(b);

        System.out.println("=====================");
        boolean b3 = !(a < b);
        System.out.println(b3);
        System.out.println(!(a > b));
    }
}
